package com.ytc.system.controller;

import com.ytc.commons.model.vo.ResponseResult;
import com.ytc.system.domain.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ytc.system.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 用户信息前端控制器
 * </p>
 *
 * @author
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService  userService;

    //查询用户信息表
    @GetMapping("/{id}")
    public ResponseResult<User> findById(@PathVariable("id") Long id) {
        return ResponseResult.okResult(userService.getById(id));
    }
}
